<div class="_goods_details">
    <!-- Left -->
    {{#include '/pages/default/public_left.html'}}

    <div class="_right">
        <div class="_right_top">
            <goods-images></goods-images>

            <div class="detail">
                <div class="titlebar">
                    <span class="name">{{goods_detail.goods_name}}</span>
                </div>
                <div class="table">
                    <div class="td">
                        <span class='price'>{{goods_detail.price_toFixed_2}}</span>
                    </div>
                    <div class="td">
                        <span>状态：</span>
                        <span class='type'>{{#if goods_detail.num==0}}缺货{{#else}}有货（{{goods_detail.num+goods_detail.unit}}）{{/if}}</span>
                    </div>
                </div>
                <div class="table">
                    <div class="td">
                        <span>数量：</span>
                        <input type="number" class="num" min=0 max="{{goods_detail.num}}" value='1' loop=1 bind-input="{{'$Cache.goods_details.buy_number'}}" />
                    </div>
                    <div class="td">
                        <button class="icon-cart2" event-click="{{'$Event.goods.add_to_cart'}}">添加到购物车</button>
                    </div>
                </div>
                <div class="decoration">
                    <div class="decoration_title">
                        <span>简要描述</span>
                        <div id="shareSNS">
                            <share share-init-key="{{goods_detail.goods_name}}" share-text="【{{goods_detail.goods_name}}】{{goods_detail.intro}}" share-detail="我觉得“{{goods_detail.goods_name}}”还不错，推荐大家一起用。" share-img="{{goods_detail.preview_img_url}}"></share>
                        </div>
                    </div>
                    <div class="decoration_text">
                        <p>{{goods_detail.intro}}</p>
                    </div>
                </div>
            </div>
        </div>


        <div class="_right_bottom">
            <div class="_right_bottom_top">
                <div class="_top_btn">商品详情</div>
                <div class="_top_btn">相关评论</div>
            </div>
            <div class="_bottom_box">
                <div>
                    {{#if !goods_detail.detail_content}}
                    <p>暂无详情</p>
                    {{/if}} {{HTML goods_detail.detail_content}}

                </div>
                <br/>{{#if !goods_detail.evaluations.length}}
                <p>暂无购买评论</p>
                {{/if}}
                <!-- 评价 -->
                {{#each goods_detail.evaluations}}
                <contentitem userimg="/images/user-img.jpg" username="{{comment.commenter_info.name}}" starnum="{{star_num}}" text="{{comment.content}}" time="{{#Time create_time}}" num1="0" num2="1" replyitem='[
                        {"replytext":"还是尽快恢复健康是房价是否健康是福sdfsdfsdf地方撒发射点发生的方式的宣传vfgsdfgdf从vefgcvfeg的从vfg","replytime":"2014-12-25 12:30","replyimg":"images/user-img.jpg"},
                        {"replytext":"d还是尽快恢复健康是房价是否健康是福sdfsdfsdf地方撒发射点发生的方式的宣传vfgsdfgdf从vefgcvfeg的从vfg","replytime":"2014-12-25 12:30","replyimg":"images/user-img.jpg"}
                        ]'></contentitem>
                {{/each}}


            </div>
        </div>
    </div>
</div>

<!-- 商品图 -->
<xmp type='tag' name='goods-images'>
    <div class="_goods_img">
        <div class="bigbox">
            <div class="movebox">
                {{#each goods_detail.detail_img_urls }}
                <img class="bigimg" bind-src="{{$This}}" />{{/each}}
            </div>
        </div>
        <div class="titlebar">
            <span class="titletext">更多图片</span>
        </div>
        <div class="smallbox">
            {{#each goods_detail.detail_img_urls }}
            <img name="{{$Index}}" class="smallimg" bind-src="{{$This}}?imageView/1/w/50/h/50" />{{/each}}
        </div>
    </div>
    <script type="text/vm">
        function(vm) { var movebox = vm.queryElement({ className: 'movebox' })[0]; var smallbox = vm.queryElement({ className: 'smallbox' })[0]; require(['jQuery'], function() { $(smallbox).on("click","img",function() { $(movebox).stop().animate({ marginTop: -270 * $(this).attr('name') }, 350); }) }); }
    </script>
</xmp>


<xmp type="tag" name="share">
    <input class="data" type="hidden" share-img="${share-img}" share-text="${share-text}" share-detail="${share-detail}" share-init-key="${share-init-key}">
    <div class="bdsharebuttonbox">
        <a href="#" class="bds_more" data-cmd="more"></a>
        <a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
        <a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
        <a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a>
        <a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网"></a>
        <a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
    </div>
    <script type="text/vm">
        function(vm){ var dataNode = vm.queryElement({ tagName:"INPUT" })[0]; var _getdata_ti = setInterval(function () { var share_init_key = dataNode.getAttribute("share-init-key"); if (share_init_key) { var share_text = dataNode.getAttribute("share-text"); var share_detail = dataNode.getAttribute("share-detail"); var share_img = dataNode.getAttribute("share-img"); window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": share_text, "bdDesc": share_detail, "bdMini": "2", "bdMiniList": false, "bdPic": share_img, "bdStyle": "0", "bdSize": "16" }, "share": {} }; clearInterval(_getdata_ti); with(document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)]; } },300); }
    </script>
</xmp>
